#!/usr/bin/env bash
. ./scripts/devcontainer/_assert-in-container "$0" "$@"

set -euo pipefail

PUBLISHED=false

for i in "$@"
do
  case "${i}" in
    --published)
      PUBLISHED=true
      ;;
    *) ARGS+=("${i}");;
  esac
done

if [[ "$PUBLISHED" == "true" ]]; then
  EXE="backend/Build/out/LocalExec/Release/net8.0/linux-x64/LocalExec"
else
  EXE="backend/Build/out/LocalExec/Debug/net8.0/LocalExec"
fi

"${EXE}" "${ARGS[@]}"
